﻿
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="renderer" content="webkit"/>
	<link rel="icon" href="favicon.ico" />
	<title>注册 - 爱尚彩</title>
	
	<script type="text/javascript" src="login/js/jquery-1.11.3.min.js"></script>
	<script src="../public/all/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="login/js/asc.min.js"></script>

    <!-- debug only -->
    <script type="text/javascript" src="login/js/layer.js"></script>
    <script type="text/javascript" src="login/js/script.js"></script>
    <script src="../public/all/js/context.js"></script>
    <script src="../public/all/js/util.js"></script>
    <script src="../public/all/js/cmd.js"></script>
    <script src="../public/all/js/classify.js"></script>
	<!-- debug only end -->

	<link media="all" href="login/style.css" type="text/css" rel="stylesheet">
</head>
<body style="background: white none repeat scroll 0% 0%;" class="index">
    <div class="container">
        <div class="content">
			<div class="logo"><img src="" height="100px"></div>
            <div class="inner">
			<a class="zxkf" href="#">在线客服</a>
			<div class="clear"></div>
					 <div class="register-form">
                        <form id="main" method="post" name="main" action="#">
                            <div class="input-group">
                                <label class="ipt-lab"><span>推荐人：</span></label>
                                <input type="text" value="" id="reg_referee" class="ipt" disabled/>
                                <span class="ipt-tip">推荐人账号，如没有可以不填</span>
                            </div>
                            <div class="input-group">
                                <label class="ipt-lab"><span style="color:#FF0000 ">*</span>会员账号：</label>
                                <input type="text" value="" id="reg_username" class="ipt"/>
                                <span class="ipt-tip">账号规则：账号必须为6-15位字母和数字组合</span>
                            </div>
                            <div class="input-group">
                                <label class="ipt-lab"><span style="color:#FF0000 ">*</span>登录密码：</label>
                                <input type="password" value="" id="reg_password" class="ipt"/>
                                <span class="ipt-tip">密码规则：密码必须为6-20位字母和数字组合</span>
                            </div>
                            <div class="input-group">
                                <label class="ipt-lab"><span style="color:#FF0000 ">*</span>确认密码：</label>
                                <input type="password" value="" id="reg_password1" class="ipt"/>
                            </div>

                            <div class="input-group">
                                <label class="ipt-lab"><span style="color:#FF0000 ">*</span>真实姓名：</label>
                                <input type="text" value="" id="reg_name" class="ipt" />
                                <span class="ipt-tip">真实姓名必须与您用于提款银行账户名称一致</span>
                            </div>
                            <div class="input-group">
                                <label class="ipt-lab"><span style="color:#FF0000 ">*</span>取款密码：</label>
                                <div style=" float:left; margin-top:5px; margin-left:15px " id="reg_take_password">
									<select>
										<option value="0">0</option>
										<option value="1">1</option>
										<option value="1">2</option>
										<option value="3">3</option>
										<option value="4">4</option>
										<option value="5">5</option>
										<option value="6">6</option>
										<option value="7">7</option>
										<option value="8">8</option>
										<option value="9">9</option>
									</select> 
									<select>
										<option value="0">0</option>
										<option value="1">1</option>
										<option value="1">2</option>
										<option value="3">3</option>
										<option value="4">4</option>
										<option value="5">5</option>
										<option value="6">6</option>
										<option value="7">7</option>
										<option value="8">8</option>
										<option value="9">9</option>
									</select> 
									<select>
										<option value="0">0</option>
										<option value="1">1</option>
										<option value="1">2</option>
										<option value="3">3</option>
										<option value="4">4</option>
										<option value="5">5</option>
										<option value="6">6</option>
										<option value="7">7</option>
										<option value="8">8</option>
										<option value="9">9</option>
									</select> 
									<select>
											<option value="0">0</option>
											<option value="1">1</option>
											<option value="1">2</option>
											<option value="3">3</option>
											<option value="4">4</option>
											<option value="5">5</option>
											<option value="6">6</option>
											<option value="7">7</option>
											<option value="8">8</option>
											<option value="9">9</option>
										</select> 
								</div>
                                <span class="ipt-tip">取款必须认证，务必记住</span>
                            </div>

                            <div class="input-group" style="position:relative ">
                                <label class="ipt-lab">QQ：</label>
                                <input type="text" value="" id="qq" class="ipt"/>
                            </div>
                            <div class="btn-group">
                                <input type="button" value="" class="btn-reg click_to_login"/>
                                <a href="#" class="btn-login"></a>
                            </div>
                        </form>
						<div style="text-align:center; clear:both; width:900px ">
							<input type="checkbox" checked>我已届满18岁合法博彩年龄，且同意各项开户条约。
						</div>
						<div class="button">
							<a href="#" class="do-register">立即提交</a>
							<a href="#" class="form-reset">重新填写</a>
							<a href="#" class="back-home">返回首页</a></div>
                    </div>
            </div>
        </div>

    </div>
    <!-- 底部 end -->
   
</body>

</html>

<script>
	// 客服代码
    Classify.queryExt("settings", "kf", false, "", function(v) {
        if (v) {
            eval(v);
        }
	});

	// LOGO
    Classify.queryExt("settings", "logo-big", false, "", function(v) {
        if (v) {
			var url = context.config.url.replace(":9090", "");
			if (urlInfo.params.try == 1) url = context.config.tryUrl.replace(":9090", "");
            $(".content .logo img").attr("src", url + v);
        }
    });
		
	$(".zxkf").click(function() {
		_MEIQIA('showPanel');
	})
	$(".back-home").click(function() {
		Util.jumpUrl({
			file: "index.html"
		});
	});
	$(".form-reset").click(function() {
		$("#reg_username").val("");
        $("#reg_password").val("");
        $("#reg_password1").val("");
        $("#reg_name").val("");
        $("#qq").val("");
		var arr = $("#reg_take_password select");
		for (var i = 0; i < arr.length; i++) {
			$(arr[i]).val(0);
		}
	});

	// 填入代理
	if (urlInfo.params.referee) {
        $("#reg_referee").val(urlInfo.params.referee);
	}
	
	$(".do-register").click(function() {
		// 提交注册
        var referee = $("#reg_referee").val().trim();
        var account = $("#reg_username").val().trim();
        var p1 = $("#reg_password").val().trim();
        var p2 = $("#reg_password1").val().trim();
        var name = $("#reg_name").val().trim();
        var p3 = "";
		var qq = $("#qq").val().trim();
		var arr = $("#reg_take_password select");
		for (var i = 0; i < arr.length; i++) {
			p3 += $(arr[i]).val();
		}

        if (account == "") {
            alert("账号名称不能为空");
            $("#reg_username").focus();
            return false;
        }
        if (! /^[0-9a-zA-Z]{6,15}$/.test(account)) {
            alert("用户名6~15位数字或字母");
            $("#reg_username").focus();
            return false;
        }
        if (!p1) {
            alert("密码不能为空");
            $("#reg_password").focus();
            return false;
        }
        if (p1.length > 20) {
            alert("密码不能大于20个字符。");
            $("#reg_password").focus();
            return false;
        }
        if (p1.length < 6) {
            alert("密码不能小于6个字符。");
            $("#reg_password").focus();
            return false;
        }
        if (p1 != p2) {
            alert("输入的密码不一致，请重新输入。");
            $("#reg_password1").focus();
            return false;
		}
		
        if (!name) {
            aler2("真实姓名不能为空");
            $("#reg_name").focus();
            return false;
        }
        if (!/^[\u4E00-\u9FA5]{2,8}$/.test(name)) {
            alert("请输入正确的真实姓名");
            $("#reg_name").focus();
            return false;
        }

        if (!qq) {
			alert("请输入联系QQ号码");
            $("#reg_qq").focus();
			return false;
		}
		if (!/^[0-9]{6,20}$/.test(qq)) {
            alert("请输入正确的QQ号码");
            $("#reg_qq").focus();
            return false;
        }

        urlInfo.params.try = 0;
        CMD.register(account, p1, name, "", referee, "pc", function(r) {
            CMD.modify_user_info(null, {
                tpassword: p3,
                qq: qq,
            }, function() {
                Util.jumpUrl({
                    file: "agreement.html"
                });
            });
        }, function(r) {
            if (r) {
				r = r.replace("手机号", "账号");
				alert("注册失败，原因：" + r);
			}
            else alert("注册失败！");
        })
		return false;
	})
</script>
